package cn.kgc.demo.controller;

import cn.kgc.demo.entity.Student;
import cn.kgc.demo.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class StudentController {
    @Resource
    private StudentService studentService;
    @RequestMapping("/find")
    public String findStudent(Model model){
        List<Student> studentList = studentService.seletctStudent();
        for (Student student : studentList) {
            System.out.println(student);
        }
        model.addAttribute("studentList",studentList);
        return "index";
    }

    @RequestMapping("/deletes")
    public String deleteStudent(){

        return "delete";
    }
}
